// 图片
export interface ImageProps {
  _id?: string;
  url?: string;
  fitUrl?: string;
  createdAt?: string;
}
// 用户信息
export interface UserProps {
  isLogin: boolean;
  nickName?: string;
  _id?: string;
  columnId?:number;
  email?: string;
  description?: string;
  avatar?: ImageProps;
}
export const currentUser: UserProps = {
  isLogin: false,
  nickName: 'viking',
  _id: 'v_123',
  columnId: 1
}
// 验证规制
export interface RuleProps {
  type: 'required' | 'email';
  message: string;
}
// Column
export interface ColumnProps {
  id: number;
  title: string;
  avatar?: string;
  description: string;
}
// 文章信息
export interface PostProps {
  id?: number;
  title: string;
  content: string;
  image?: string | string;
  author?: string;
  createdAt?: string;
}
export interface GlobalErrorProps {
  status: boolean;
  message?: string;
}
// 全局数据类型
export interface GlobalDataProps {
  token: string;
  error: GlobalErrorProps;
  loading: boolean;
  columns: ColumnProps[]; // 专栏
  posts: PostProps[]; // 文章
  user: UserProps; // 作者（author）
}

export type MessageType = 'success' | 'error' | 'default'

export interface ResponseType<P> {
  code: number;
  msg: string;
  data: P;
}
